package com.pentofab.payrollmanagement.database.impl;

public interface UserAccountsTableSQLConstants extends SQLConstants{
	
	String tableName = "useraccounts";
	
	String username =tableName+".username"; 
	String password =tableName+".password";
	String createdby =tableName+".createdby";
	String modifiedby =tableName+".modifiedby";
	String creationdate =tableName+".creationdate";
	String modificationdate =tableName+".modificationdate";
	String validity =tableName+".validity";
	String active =tableName+".active";
	String permissions = tableName+".permissions";
	String deleted = tableName+".deleted";
	String securityQuestion =  tableName+".question";
	String answer = tableName+".answer";
	
	String getAccountsByParent = new StringBuffer(select)
			.append(username).append(comma)
			.append(password).append(comma)
			.append(createdby).append(comma)
			.append(modifiedby).append(comma)
			.append(creationdate).append(comma)
			.append(modificationdate).append(comma)
			.append(validity).append(comma)
			.append(active).append(comma)
			.append(permissions).append(comma)
			.append(securityQuestion).append(comma)
			.append(answer).append(from)
			.append(tableName).append(where)
			.append(createdby).append(equals)
			.append(question).append(and)
			.append(deleted).append(equals).append(question).toString();
	
	String getAccountsByUserName = new StringBuffer(select)
			.append(username).append(comma)
			.append(password).append(comma)
			.append(createdby).append(comma)
			.append(modifiedby).append(comma)
			.append(creationdate).append(comma)
			.append(modificationdate).append(comma)
			.append(validity).append(comma)
			.append(active).append(comma)
			.append(permissions).append(comma)
			.append(securityQuestion).append(comma)
			.append(answer)
			.append(from)
			.append(tableName).append(where)
			.append(username).append(equals)
			.append(question).append(and)
			.append(deleted).append(equals).append(question).toString();
	
	String createAccount = new StringBuffer(insert_into).append(tableName).append(openingBrace)
			.append(username).append(comma)
			.append(password).append(comma)
			.append(createdby).append(comma)
			.append(creationdate).append(comma)
			.append(modifiedby).append(comma)
			.append(modificationdate).append(comma)
			.append(validity).append(comma)
			.append(permissions).append(comma)
			.append(active).append(comma)
			.append(securityQuestion).append(comma)
			.append(answer).append(closingBrace)
			.append(values).append(openingBrace)
			.append("?,?,?,?,?,?,?,?,?,?,?").append(closingBrace)
			.toString();
	

	String modifyUserAccounts = new StringBuffer(update).append(tableName).append(set)
			.append(username).append(equals).append(question).append(comma)
			.append(password).append(equals).append(question).append(comma)
			.append(createdby).append(equals).append(question).append(comma)
			.append(creationdate).append(equals).append(question).append(comma)
			.append(modifiedby).append(equals).append(question).append(comma)
			.append(modificationdate).append(equals).append(question).append(comma)
			.append(validity).append(equals).append(question).append(comma)
			.append(permissions).append(equals).append(question).append(comma)
			.append(active).append(equals).append(question).append(comma)
			.append(securityQuestion).append(equals).append(question).append(comma)
			.append(answer).append(equals).append(question)
			.append(where).append(username).append(equals).append(question)
			.toString();
	
	String deleteUser = new StringBuffer(update).append(tableName).append(set)
			.append(deleted).append(equals).append(question).append(where).append(username).append(equals).append(question).toString();
	

}
